import execjs,requests,base64,json

def get_encrypt_data():
    url = "https://vipapi.qimingpian.com/DataList/productListVip"
    data = {'time_interval': '','tag': '','tag_type': '',
            'province': '','lunci': '','page': 1,'num': 20,'unionid': '',}

    response = requests.post(url, data=data)
    response.encoding = 'utf-8'
    if response.status_code == 200:
        return response.json()['encrypt_data']
    return None

def get_data(encrypt):
    with open('qmkj.js','r') as f:
        jscode = f.read()

    m = execjs.compile(jscode).call('my_decrypt',encrypt)
    data_ = json.loads(base64.b64decode(m).decode('utf8'))['list']
    for item in enumerate(data_,start=1):
        print(item)

if __name__ == '__main__':
    encrypt = get_encrypt_data()
    get_data(encrypt)